package com.example.communist_app_api.db.dao;


import com.example.communist_app_api.db.pojoDto.Article;
import com.example.communist_app_api.db.pojoDto.CarouselMap;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ArticleDao {

    List<Article> getAllArticle();

    int insertArticle(Article article);

    void deleteArticle(Integer id);

    Article getArticleById(Integer id);

    List<Article> getTopArticle(Integer organizationId);

    Boolean updateTopArticle(@Param("isTop")Integer isTop,@Param("id")Integer id);

    List<Article> getCategorizeArticles(Integer articleTypeId);

    boolean UpdateReading(Integer id);

    int getReading(Integer id);

    List<CarouselMap> getCarouselMap();

    boolean isCarouselMap(Integer id);

    boolean noCarouselMap(Integer id);

    List<Article> SearchQueryArticles(String title);

    List<Article> getArticleByParentId(Integer organizationId);

    List<Article> getAllTopArticle();

    List<Article> getOrganizationIdCategorizeArticles(@Param("articleTypeId")Integer articleTypeId,@Param("organizationId")Integer organizationId);

    List<Article> SearchQueryOrganizationIdArticles(@Param("title")String title,@Param("organizationId")Integer organizationId);
}
